process.c, Rules.mk:
Fix bug when context-switching LDT in Xenolinux.
LOAD_BASE := 0x00100000
CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
CFLAGS += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE)
-#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
-CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
+CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
+#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
CFLAGS += -Wno-pointer-arith -Wredundant-decls
LDFLAGS := -T xeno.lds -N
__cli();
+ /*
+ * We clobber FS and GS here so that we avoid a GPF when restoring previous
+ * task's FS/GS values in Xen when the LDT is switched. If we don't do this
+ * then we can end up erroneously re-flushing the page-update queue when
+ * we 'execute_multicall_list'.
+ */
+ __asm__ __volatile__ (
+ "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs" : : : "eax" );
+
MULTICALL_flush_page_update_queue();
/*